<?php
declare (strict_types = 1);

namespace app\index\controller;

class Index
{
    public function menu()
    {
        $data = [
            [
                'id' => 10,
                'label' => '产品&文档',
                'path' => '/products',
                'icon' => 'ri-product-hunt-line',
                'order' => 20,
                'children' => [
                    [
                        'id' => 101,
                        'label' => 'Cool-UniX',
                        'path' => '/products/cool-unix',
                        'icon' => 'ri-apps-2-line',
                        'authRequired' => false,
                    ],
                    [
                        'id' => 102,
                        'label' => 'Cool-Admin',
                        'path' => '/products/cool-admin',
                        'icon' => 'ri-dashboard-2-line',
                        'authRequired' => true,
                    ],
                ],
            ],
            [
                'id' => 20,
                'label' => '外部文档',
                'path' => 'https://docs.example.com',
                'target' => '_blank',
                'icon' => 'ri-book-open-line',
                'order' => 30,
            ],
        ];

        return json([
            'code' => 200,
            'data' => $data,
        ]);
    }
}
